package com.citas.client.widget;

import java.util.Date;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.HasText;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.PasswordTextBox;
import com.google.gwt.user.client.ui.TextArea;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.Widget;

public class Suggest extends Composite implements HasText {

	private static SuggestUiBinder uiBinder = GWT.create(SuggestUiBinder.class);

	PanelReservaCita obj = null;
	@UiField DialogBox suggesdialog;
	//@UiField TextBox user;
	//@UiField TextArea sugmess;
	@UiField Label mesagelabel; 
	@UiField Button showsugg;
	//@UiField Label mensajes;
	Command comando=null;
	interface SuggestUiBinder extends UiBinder<Widget, Suggest> {
	}

	public Suggest(Command co) {
		initWidget(uiBinder.createAndBindUi(this));
		suggesdialog.show();
		comando=co;
		Date op= new Date();
		
		mesagelabel.setText("Puede buscar Citas disponibles el dia de Hoy :"+op );
		//sugmess.setText("Sugerencias para el dia de Hoy:");
		suggesdialog.setTitle("Sugerencias para el dia de Hoy:");
		suggesdialog.setAutoHideEnabled(true);
		suggesdialog.center();
	}

	

	public Suggest(String firstName) {
		initWidget(uiBinder.createAndBindUi(this));
		
	}
	public void mostrar(){
		suggesdialog.show();
	}
	public void addObjt(PanelReservaCita obj)
	{
		this.obj=obj;
		
	}

	
	@UiHandler("showsugg")
	void onShowsuggClick(ClickEvent event) 
	{
		suggesdialog.hide();
		//password.setText("");
		obj.findSugg();
		
	}



	@Override
	public String getText() {
		// TODO Auto-generated method stub
		return null;
	}



	@Override
	public void setText(String text) {
		// TODO Auto-generated method stub
		
	}



}
